package cn.edu.zut.cs.controller;

import cn.edu.zut.cs.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * 视图跳转控制器,只用于视图跳转
 */
@Controller
public class CommentController {
    @RequestMapping("/index")
    public String index(){ return "index"; }

    @RequestMapping("/home")
    public String admLogin(){ return "home"; }


    @RequestMapping("/register")
    public String register(){return "register";}

    @RequestMapping("/equipment")
    public String equipment(){ return "equipment"; }

    @RequestMapping("/equipment_add")
    public String equipment_add(){ return "equipment_add"; }

    @RequestMapping("/equipment_modify")
    public String equipment_modify(){ return "equipment_modify"; }

    @RequestMapping("/weight_data")
    public String weight_data(){ return "weight_data"; }

    @RequestMapping("/camera")
    public String camera(){ return "camera"; }

    @RequestMapping("/my_modify")
    public String my_modify(){ return "my_modify"; }

    @RequestMapping("/anomalies_alarms")
    public String anomalies_alarms(){ return "anomalies_alarms"; }

    @RequestMapping("/detail_data")
    public String detail_data(){ return "detail_data"; }

    @RequestMapping("/home_panel")
    public String home_panel(){ return "home_panel"; }

    @RequestMapping("/staff_management")
    public String staff_management(){ return "staff_management"; }

    @RequestMapping("/404_1")
    public String tao404_1(){ return "404_1"; }

    @RequestMapping("/limit")
    public String Limit(HttpSession session){
        User loginUser = (User) session.getAttribute("loginUser");
        if(loginUser.getUserlevel()==1){
            return "detail_data";
        }else{
            return "detail_data1";
        }
    }

    @RequestMapping("/camera2")
    public String camera2(){ return "camera2"; }

    @RequestMapping("/camera3")
    public String camera3(){ return "camera3"; }
}
